package com.pingxx.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pingxx.demo.entity.User;
import com.pingxx.demo.mapper.UserMapper;
import com.pingxx.demo.service.IUserService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author pingxx
 * @since 2020-04-26
 */
@CacheConfig(cacheNames = "userCache")
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Cacheable
    @Override
    public User getByName(String name) {
        return baseMapper.selectByName(name);
    }
}
